//
//  ConclusionView.swift
//  SidebarMenu
//
//  Created by LiangXiaobin on 2017/2/3.
//  Copyright © 2017年 AppCoda. All rights reserved.
//

import UIKit

class ConclusionView: UIView {

    var title:UILabel?
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        title = UILabel(frame:CGRect(x:0,y:0,width:frame.width,height:30))
        title?.backgroundColor = baseColor
        title?.textColor = UIColor.white
        title?.font = UIFont.systemFont(ofSize: 18)
        self.addSubview(title!)
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    func setTitle(tittle:String,message:[String]) {
        self.title?.text = tittle
        if message.count > 0 {
            
            for i in stride(from: 0, through: message.count, by: 1) {
            
                let label = UILabel(frame:CGRect(x:5,y:30 + i * 25,width:Int(self.frame.width - 10),height:25))
                label.textColor = messageColor
                label.text = message[i]
                self.addSubview(label)
                label.adjustsFontSizeToFitWidth = true
            }
        }
    }
    
    
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
